﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace NAntExt
{
    public class ParallelTask
    {
        public ParallelTask(Guid id, Thread thread, string description)
        {
            if (thread == null)
            {
                throw new System.ArgumentNullException("thread");
            }
            this.ParallelThreadId = id;
            this.Thread = thread;
            this.Exceptions = new TQueue<Exception>();
            this.CompletedEvent = new ManualResetEvent(false);
            this.Description = description;
            this.Timer = new System.Diagnostics.Stopwatch();
        }

        public string Description { get; set; }
        public ManualResetEvent CompletedEvent { get; private set; }
        public Guid ParallelThreadId { get; private set; }
        public Thread Thread { get; private set; }
        public TQueue<Exception> Exceptions { get; private set; }
        public System.Diagnostics.Stopwatch Timer { get; private set; }

    }
}